-- This is the procedure with static SQL
-- Safe from SQL injection!!

CREATE OR REPLACE
PROCEDURE get_income_level (p_email VARCHAR2 DEFAULT NULL)
AS

BEGIN

FOR i IN
  (SELECT income_level 
   FROM customers 
   WHERE cust_email = p_email)
  LOOP
      DBMS_OUTPUT.PUT_LINE('Income level is: '||i.income_level);
  END LOOP;

END get_income_level;
/
